import request from '@/utils/request'

// 查询兑换码列表
export function listRedeemCode(query) {
  return request({
    url: '/biz/redeemCode/list',
    method: 'get',
    params: query
  })
}

// 查询兑换码详细
export function getRedeemCode(id) {
  return request({
    url: '/biz/redeemCode/' + id,
    method: 'get'
  })
}

// 新增兑换码
export function addRedeemCode(data) {
  return request({
    url: '/biz/redeemCode',
    method: 'post',
    data: data
  })
}

// 修改兑换码
export function updateRedeemCode(data) {
  return request({
    url: '/biz/redeemCode',
    method: 'put',
    data: data
  })
}

// 删除兑换码
export function delRedeemCode(id) {
  return request({
    url: '/biz/redeemCode/' + id,
    method: 'delete'
  })
}
// 发送验证码
export function sendSmsRedeemCode(query) {
  return request({
    url: '/biz/redeemCode/sendSms',
    method: 'get',
    params: query
  })
}
// 导出兑换码
export function exportRedeemCode(query) {
  return request({
    url: '/biz/redeemCode/export',
    method: 'post',
    data: query,
    responseType: 'blob'
  })
}

export function updateStatus(data){
 return request({
    url: '/biz/redeemCode/updateStatus',
    method: 'post',
    data: data
  })
}
